#ifndef VECTOR2D_H
#define	VECTOR2D_H

#include <string>
#include "tinyxml.h"

using namespace std;

namespace TP { namespace Matematica {

class Vector2D {
public:
    Vector2D();
    
    Vector2D(double pX, double pY);

    virtual ~Vector2D();
    
    double X() const;
    
    double X(double pX);
    
    double Y() const;
    
    double Y(double pY);
    
    double norma() const;
    
    double operator* (const Vector2D& pOperando);
    
    const Vector2D operator+ (const Vector2D& pOperando) const;
    
    const Vector2D operator- (const Vector2D & pOperando) const;

    const Vector2D operator* (double pEscalar) const;
    
    Vector2D operator= (const Vector2D pOperando);
    
    const Vector2D direccion() const;
    
    double angulo () const;
    
    virtual string aXML();
    
    virtual string aXML(const string& pPath);
    
    virtual void parseXML (const string& pDescriptor);
    
    virtual TiXmlElement* aElementoXML ();
    
    virtual void deElementoXML (TiXmlElement* pElemento);

private:
    double   _x, _y;
};
}}

#endif	/* VECTOR2D_H */

